package router

import (
	"ChdChat-Gin/api"
	"ChdChat-Gin/middleware"
	"github.com/gin-gonic/gin"
)

func chatGroupGroup(subRouter *gin.RouterGroup) {
	chatGroupRouter := subRouter.Group("/v1.0")
	{
		// chat groups
		chatGroupRouter.POST("/chat-groups", middleware.Authenticate(), api.CreateChatGroup)
		chatGroupRouter.DELETE("/chat-groups", middleware.Authenticate(), api.DissolveChatGroup)
		chatGroupRouter.PUT("/chat-groups", middleware.Authenticate(), api.UpdateChatGroupInfo)
		// group members
		chatGroupRouter.POST("/group-members", middleware.Authenticate(), api.AddMembers)
		chatGroupRouter.DELETE("/group-members", middleware.Authenticate(), api.DeleteMembers)
	}
}
